package com.example.dingdong.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.example.dingdong.daomain.BossEntity;

@Repository
public interface BossRepository extends JpaRepository<BossEntity,Long>{
	/**
	 * 
	 * @Title: findByDelFlag
	 * @Description: 获取所未删除的老板
	 * @author: chengwenxing
	 * @DateTime 2021-08-05 14:53:54
	 * @param delFlag
	 * @return
	 */
	List<BossEntity> findByDelFlag(boolean delFlag);
	/**
	 * 
	 * @Title: findByIdAndDelFlag
	 * @Description:根据id查询数据 
	  * @author: chengwenxing
	 * @DateTime 2021-08-05 15:12:59
	 * @param id
	 * @param delFlag
	 * @return
	 */
	BossEntity findByIdAndDelFlag(Long id,boolean delFlag);

	
	/**
	 * 
	 * @Title: finLandlordByName
	 * @Description: （描述）根据房东姓名查找
	 * @author: chengwenxing
	 * @return: LandlordEntity
	 * @date: 2021-08-08 11:02:03 
	 * @param name
	 * @param delFlag
	 * @return
	 */
	@Query(value = "SELECT * FROM landlord_entity WHRER del_flag = true AND name = ?1",nativeQuery = true)
	BossEntity finBossByNameAndDelFlag(String name,boolean delFlag);
}
